package pers.xx.sbm.controller;

import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import pers.xx.sbm.entity.Person;
import pers.xx.sbm.service.PersonService;

/**
 * @author ：xxx
 * @description：TODO
 * @date ：2020/7/19 15:34
 */


@RestController
public class PersonController {

    @Autowired
    private PersonService personService;

    @RequestMapping("/getUser/{id}")
    public Person GetUser(@PathVariable int id) {
        return personService.sel(id);
    }

    @RequestMapping("/listUser")
    public PageInfo<Person> listByPage(Person person, Integer page, Integer limit) {
        return personService.listByPage(person, page, limit);
    }
}